/**
 * 在生产环境 代理是无法生效的，所以这里没有生产环境的配置
 */
import gctjson from '../gct.env.json';
const {CASTOKEN} = gctjson;

export default {
  dev: {},
  yapi: {
    '/api': {
      target: 'https://api.baijia.com/mock/2545',
      headers: {
        cookie: `_const_d_jsession_id_=${CASTOKEN}`
      },
      changeOrigin: true,
      pathRewrite: { '^': '' },
    },
  },
  rd: {
    '/api': {
      // rd机器地址
      target: 'http://127.0.0.1:3000',
      headers: {
        cookie: `_const_d_jsession_id_=${CASTOKEN}`
      },
      changeOrigin: true,
      pathRewrite: { '^/api': '' },
    },
  },
  test: {
    '/api': {
      target: '替换成test环境的地址',
      headers: {
        cookie: `_const_d_jsession_id_=${CASTOKEN}`
      },
      changeOrigin: true,
      pathRewrite: { '^': '' },
    },
  },
  beta: {
    '/api': {
      target: '替换成beta环境的地址',
      changeOrigin: true,
      headers: {
        cookie: `_const_d_jsession_id_=${CASTOKEN}`
      },
      pathRewrite: { '^': '' },
    },
  },
  prod: {
    '/api': {
      target: '替换成线上环境的地址',
      headers: {
        cookie: `_const_d_jsession_id_=${CASTOKEN}`
      },
      changeOrigin: true,
      pathRewrite: { '^': '' },
    },
  },
};
